<?php
 
require_once("curl.php");
 
$query = "web spiders";
 
$curl = new Curl();
$response = $curl->get( "http://www.google.com/search",$vars = array("q"=>$query) );
 
$domDocument = new DOMDocument();
$domDocument->loadHTML($response->body);
 
$documentLinks = $domDocument->getElementsByTagName("table");
echo $documentLinks;
/* 
for($i=0;$i<$documentLinks->length;$i++) 
{
	$documentLink = $documentLinks->item($i);
 
	if($documentLink->getAttribute("class") == "l")
	{
		echo $documentLink->getAttribute("href")."<br>";
	}
}
 */
?>

